Cacti : Install
2015/03/05 |
Install Cacti to monitor system status.
|
|
[1] | |
[2] | |
[3] | |
[4] | Install Cacti, SNMP. |
# install from EPEL [root@dlp ~]# yum --enablerepo=epel -y install cacti net-snmp net-snmp-utils php-mysql php-snmp rrdtool
|
[5] | Configure SNMP (Simple Network Management Protocol). |
[root@dlp ~]#
vi /etc/snmp/snmpd.conf # line 41: comment out # com2sec notConfigUser default public
# line 74,75: uncomment and change # change "mynetwork" to your own network # change comunity name to anyone except public, private (for security reason) com2sec local localhost Serverworld com2sec mynetwork 10.0.0.0/24 Serverworld # line 78,79: uncomment group MyRWGroup any local group MyROGroup any mynetwork # line 85: uncomment view all included .1 80 # line 93,94: uncomment access MyROGroup "" any noauth 0 all none none access MyRWGroup "" any noauth 0 all all all # validation (replace "Serverworld" to the comunity name you set) [root@dlp ~]# snmpwalk -v2c -c Serverworld localhost system SNMPv2-MIB::sysDescr.0 = STRING: Linux dlp.srv.world 2.6.32-504.3.3.el6.x86_64 #1 SMP Wed Dec 17 01:55:02 UTC 2014 x86_64 SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (168142) 0:28:01.42 ... ... SNMPv2-MIB::sysORUpTime.7 = Timeticks: (4) 0:00:00.04 SNMPv2-MIB::sysORUpTime.8 = Timeticks: (4) 0:00:00.04 |
[6] | Create a Database for Cacti and import tables. |
[root@dlp ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 5.1.73 Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. # create a "Cacti" database ( set any password for 'password' section )
mysql>
create database cacti; Query OK, 1 row affected (0.00 sec)
mysql>
grant all privileges on cacti.* to cacti@'localhost' identified by 'password'; Query OK, 0 rows affected (0.00 sec)
mysql>
flush privileges; Query OK, 0 rows affected (0.00 sec)
mysql>
[root@dlp ~]# exit Bye mysql -u cacti -p cacti < /usr/share/doc/cacti-*/cacti.sql Enter password: # cacti user's password |
[7] | Configure Cacti. |
[root@dlp ~]#
vi /etc/cron.d/cacti # uncomment */5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
[root@dlp ~]#
vi /usr/share/cacti/include/config.php # line 30: change to the connection info to MySQL DB $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = " cacti ";$database_password = " password ";$database_port = "3306"; $database_ssl = false;
[root@dlp ~]#
vi /etc/httpd/conf.d/cacti.conf # line 23: add access permission if need Allow from localhost 10.0.0.0/24
/etc/rc.d/init.d/httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] |